#ifndef __GLOBALMESSAGE_H_
#define __GLOBALMESSAGE_H_


#include <stdbool.h>

#define NameSize 20
#define ContentSize 1024
//在线用户结构体
struct ClientInfo
{
    char ClientName[NameSize];
    int sock;
};
typedef struct ClientInfo CInfo;

CInfo* CreateCInfo(const char *name,int sock);
void PrintCInfo(void *p);
bool IsClientNameEqual(void *ClientPtr,void* clientName);
bool IsClientSockEqual(void *ClientPtr,void* sock);



enum Request
{
    LOGIN = -2, //登录
    SIGNUP = -1,//注册
    CHAT=1, //私聊
    BROADCAST, //广播
    ONLINELIST, //在线列表
    SENDFILE,  //发送文件
    MYCLOUD, //我的网盘
    FRIENDMANAGE, //好友管理
    GROUPMANAGE, //群管理
    OFFLINEMESSAGE, //离线消息

    ADDFRIEND = 32, //添加好友
    MYFRIENDLIST, //我的好友列表
    DELETEFRIEND, //删除好友
    FRIENDCHAT, //好友聊天
    MYFRIENDREQUEST, //我的好友请求
    CALLFRIENDREQUEST, //回复好友请求
    FROMFRIENDMANAGETOMAINMENU, //返回主菜单

    CREATEGROUP = 64, //创建群
    VISITWHOJOINGROUP, //添加群成员
    INVITATIONJOINGROUPNOTIFICATION,// 邀请入群通知
    PROCESSGROUPINVITATION, //处理入群邀请
    GROUPMESSAGERECORD, //群聊
    MYGROUPLIST, //我的群列表
    DELETEGROUP, //删除群
    FROMGROUPMANAGETOMAINMENU, //返回主菜单
    

    FILELIST = 128 , //查看网盘文件列表
    UPLOAD,//上传
    DOWNLOAD, //下载
    RETURNTOMAINMENU, //返回主菜单
    
};
//信息结构体
struct GlobalMessage
{
    char FromName[NameSize]; //信息来源
    char ToName[NameSize];  //信息目标
    char Content[ContentSize]; //信息主体
    int flag; //功能标志位
};

typedef struct GlobalMessage MSG;

#endif